﻿using System;
using System.Xml.Serialization;
using EpiNEXT.Core.Fields;

namespace EpiNEXT.Core.Validation.Actions
{
    [Serializable()]
    public sealed class Action_Disable : ActionBase
    {
        public override void Execute(Record record)
        {
            DataEntryInstrument form = record.Form;

            foreach (string fieldName in this.TargetNames)
            {
                IField field = form.Fields[fieldName];
                field.IsCurrentlyEnabled = false;
            }
        }
    }
}
